package com.yinhe.music.yhmusic.manager;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.common.GlideHelper.GlideHelper;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.model.SongMenuList;

import java.util.List;

/**
 * Created by hasee on 2017/8/15.
 */

public class CollectionDialogAdapter extends BaseQuickAdapter<SongMenuList, BaseViewHolder> {

    public CollectionDialogAdapter( @Nullable List<SongMenuList> data) {
        super(R.layout.dialog_collection_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SongMenuList item) {
        helper.setText(R.id.menu_name, item.getSongMenuName())
                .setText(R.id.song_sum, item.getSongNum()+"首");
        ImageView image = helper.getView(R.id.image);
        GlideHelper.setImageResource(image,item.getImage(),R.drawable.default_cover);
    }
}
